import Vue from "vue";
import Router from "vue-router";
import Login from "@/components/Login.vue";
import Admin from "@/components/Admin.vue";
import AdminIndex from "@/components/Index.vue";
import PersonalInfo from "@/components/personal/Info.vue";
import ConsultationOrder from "@/components/consultation/Order.vue";
import ConsultationList from "@/components/consultation/List.vue";
import ConsultationImText from "@/components/consultation/im/Text.vue";
import ReferralOrder from "@/components/referral/Order.vue";
import ReferralInfo from "@/components/referral/Info.vue";
import ReplyList from "@/components/reply/List.vue";
import ReplyInfo from "@/components/reply/Info.vue";
import CommissionList from "@/components/commission/List.vue";
import MyAnswerList from "@/components/myAnswer/List.vue";
import NoticeList from "@/components/notice/List.vue";
import FeedbackList from "@/components/feedback/List.vue";
import FeedbackAdd from "@/components/feedback/Add.vue";
import FeedbackInfo from "@/components/feedback/Info.vue";
import ReservationInfo from "@/components/pet/reservation/Info.vue";
import Chat from "@/components/chat/Chat.vue"
Vue.use(Router);

export default new Router({
  routes: [{
      path: "/login",
      name: "Login",
      component: Login
    },
    {
      path: "/admin",
      name: "Admin",
      component: Admin,
      children: [{
          path: "",
          name: "AdminIndex",
          component: AdminIndex
        },
        // 聊天记录
        {
          path: '/chat/:sessionId',
          name: 'Chat',
          component:Chat
        },
        {
          path: "personal/info",
          name: "PersonalInfo",
          component: PersonalInfo
        },
        {
          path: "consultation/order",
          name: "ConsultationOrder",
          component: ConsultationOrder
        },
        {
          path: "consultation/list",
          name: "ConsultationList",
          component: ConsultationList
        },
        {
          path: "consultation/pet/:id/im/text",
          name: "ConsultationImText",
          component: ConsultationImText
        },
        {
          path: "referral/order",
          name: "ReferralOrder",
          component: ReferralOrder
        },
        {
          path: "referral/:consultationId/info",
          name: "ReferralInfo",
          component: ReferralInfo
        },
        {
          path: "reply/list",
          name: "ReplyList",
          component: ReplyList
        },
        {
          path: "reply/:consultationId/info",
          name: "ReplyInfo",
          component: ReplyInfo
        },
        {
          path: "commission/list",
          name: "CommissionList",
          component: CommissionList
        },
        {
          path: "myAnswer/list",
          name: "MyAnswerList",
          component: MyAnswerList
        },
        {
          path: "notice/list",
          name: "NoticeList",
          component: NoticeList
        },
        {
          path: "feedback/list",
          name: "FeedbackList",
          component: FeedbackList
        },
        {
          path: "feedback/add",
          name: "FeedbackAdd",
          component: FeedbackAdd
        },
        {
          path: "feedback/:id/Info",
          name: "FeedbackInfo",
          component: FeedbackInfo
        },
        {
          path: "pet/reservation/:id/info",
          name: "ReservationInfo",
          component: ReservationInfo
        },
        {
          path: "*",
          redirect: {
            name: "AdminIndex"
          }
        }
      ]
    }
  ]
});
